import React, { Component } from 'react';
import NarBar from './narbar';
import { Routes, Route, Navigate } from 'react-router-dom';
import Home from './contents/home';
import Login from './contents/login';
import Register from './contents/register';
import Calculator from './contents/calculator';
import NotFound from './contents/notfound';

class App extends Component {
    state = {  } 
    render() { 
        return (<React.Fragment>
            <NarBar />
            <Routes>
                <Route path='/' element={<Home />}/>
                <Route path='/home' element={<Home />}/>
                <Route path='/login' element={<Login />}/>
                <Route path='/register' element={<Register />}/>
                <Route path='/calculator' element={<Calculator />}/>
                <Route path='/404' element={<NotFound />}/>
                <Route path='*' element={<Navigate replace to="/404" />} />
            </Routes>
        </React.Fragment>);
    }
}
 
export default App;